import request from "@/util/api.js"


/**
 * 校验订单
 * @param {*} data 
 */
export function orderCheckApi(data) {
	return request.post('v2/order/check', data)
}

/**
 * 确认收货
 * @param {*} order_id 
 */
export function orderTakeApi(order_id) {
	return request.post(`order/take/${order_id}`)
}

/**
 * 以总单查看商品详情
 * @param {Object} order_group_id
 */
export function getGroupOrderDetailApi(order_group_id) {
	return request.get(`order/group_order_detail2/${order_group_id}`)
}

/**
 * 子单售后申请
 * @param {Object} orderId		子单id
 * @param {Object} data			
 */
export function refundApi(orderId, data) {
	return request.post(`refund/apply/${orderId}`, data)
}

/**
 * 再次购买
 * @param {Object} data
 */
export function againApi(data) {
	return request.post('user/cart/again', data)
}

/**
 * 帮买订单  详情
 * @param {*} group_order_id 
 */
export function getHelpBuyGroupOrderDetails(group_order_id) {
	return request.get(`order/group_order_detail_help/${group_order_id}`)
}

/**
 * 去帮买支付
 * @param {Object} group_order_id
 * @param {Object} data
 */
export function payHelpOrder(group_order_id, data) {
	return request.post(`order/pay2/${group_order_id}`, data)
}


/**
 * 获取配送时间配置
 */
export function getOrderDeliveryTimeConfigApi() {
	return request.get('order/delivery_time')
}

/**
 * 用户删除订单
 * @param {*} gorup_order_id 
 */
export function userDeleteGroupOrderApi(gorup_order_id) {
	return request.post(`order/delGroupOrder/${gorup_order_id}`)
}
